﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UCLogin.ascx.cs" Inherits="WebUI.UserControls.UCLogin" %>
<div class="MessageBoxBackgroundLogin" id="pageDimmerLogin">&nbsp;</div>
<div class="MesageBoxDivLogin" id="msgboxLogin">
    <div style="margin:10px;">    
    <div class="MesageBoxTableLogin" id="msgTableLoginLogin">
        <div class="Logincontents">
            <div class="Logintitleclose" onclick="CloseLogin();"><img src="/Images/adler_close.gif" alt="" style="height:24px; width:24px;" /></div>
            <div class="Logintitle">LOG IN / CREATE ACCOUNT</div>
            <div class="Logintitlecontents">
                <div class="leftlogin">
                    <div class="title">PLEASE LOGIN TO YOUR ADLER  ACCOUNT</div>
                    <div class="text">Enter your e-mail address and password to log in.</div>
                    <div class="text" style="margin-top:10px;">Email</div>
                    <div class="div_border_textbox">
                        <asp:TextBox ID="txtEmail" runat="server" MaxLength="50" CssClass="csstextbox"></asp:TextBox>
                    </div>
                    <div class="text" style="margin-top:10px;">Password</div>
                    <div class="div_border_textbox">
                        <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" MaxLength="50" CssClass="csstextbox"></asp:TextBox>
                    </div>
                    <div class="text">Have you forgotten your password?</div>
                    <asp:Button ID="btnLogin" runat="server" Text="LOG IN" CssClass="button" OnClientClick="return checkemptyLogin();"
                        onclick="btnLogin_Click" />
                </div>
                <div class="rightlogin">
                    <div class="title" style="width:229px;">NEW ADLER CUSTOMER</div>
                    <div class="text" style="width:229px; line-height:15px;">                        If you still don't have a Adler account, use this option to access the registration form.<br /><br />                        By giving us your details, purchasing in Adler will be a faster and enjoyable experience.</div>
                    <div class="button" style="width:200px; margin-top:70px;" onclick="OpenRegister();">CREATE ACCOUNT</div>
                </div>
            </div>
        </div>
    </div>
    </div>
</div>

<script type="text/javascript">
    function checkemptyLogin() {
        var txtEmail = document.getElementById('<%=txtEmail.ClientID %>').value.trim();
        var txtPassword = document.getElementById('<%=txtPassword.ClientID %>').value.trim();

        if (txtEmail == null || txtEmail == '') {
            alert("Email is empty!");
            document.getElementById('<%=txtEmail.ClientID %>').focus();
            return false;
        }

        if (txtPassword == null || txtPassword == '') {
            alert("Password is empty!");
            document.getElementById('<%=txtPassword.ClientID %>').focus();
            return false;
        }

        var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
        if (!filter.test(txtEmail)) {
            alert("Email is not correct!");
            document.getElementById('<%=txtEmail.ClientID %>').value = '';
            document.getElementById('<%=txtEmail.ClientID %>').focus();
            return false;
        }
        return true;
    }
</script>